﻿using PowerBooking.RSE.Poco;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Data.Objects;
using System.Linq;
using System.Text;
using PowerBooking.RSE.IRepository;

namespace PowerBooking.RSE.Repository.Repositories
{
    /// <summary>
    /// 餐厅仓储
    /// </summary>
    public class RestaurantRepository : RestaurantSpiderEngineRepository, IRestaurantRepository
    {
        public RestaurantRepository(IUnitOfWork unitOfWork) : base(unitOfWork) { }

        /// <summary>
        /// 插入一个餐厅
        /// </summary>
        /// <param name="restaurantPoco"></param>
        /// <returns></returns>
        public void InsertRestaurant(RestaurantPoco restaurantPoco)
        {
            Context.Restaurants.AddObject(restaurantPoco);
            Context.SaveChanges(SaveOptions.None);
        }
    }
}
